import request from '@/utils/request'
import * as URL from '@/constants/api'
import dayjs from 'dayjs'

// // 员工列表
export function getList(data) {
  return request({
    url: URL.SOCIAL_SECURITY,
    method: 'post',
    data
  })
    .then(res => {
      res.data.data.rows = res.data.data.rows.map(d => ({
        ...d,
        timeOfEntry: dayjs(d.timeOfEntry).format('YYYY-MM-DD'),
        correctionTime: dayjs(d.correctionTime).format('YYYY-MM-DD')
      }))
      return res.data.data
    })
}

// 新增员工
export function getCityList() {
  return request({
    url: URL.CITY
  })
    .then(res => res.data.data)
}
